<template>
    <div class="account-page">
        <div class="account-center">
            <div class="account-box">
                <form action="#" class="form-signin" ref="form">
                    <div class="account-logo"><a href="#"><img src="/src/assets/static/picture/logo-dark.png"
                                alt="低值易耗品管理系统"></a>
                    </div>
                    <div class="form-group"><label>用户名</label><input type="text" class="form-control"
                            v-model="form.username"></div>
                    <div class="form-group"><label>密码</label><input type="password" class="form-control"
                            v-model="form.password">
                    </div>
                    <!-- <div class="form-group text-right"><a href="#">忘记密码?</a>
                    </div> -->
                    <div class="form-group text-center">
                        <button type="submit" class="btn btn-primary account-btn" @click="login()">登录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            form: {
                username: '',
                password: ''
            },
            // rules:{
            //     username:[
            //         { required: true, message: '请输入用户名', trigger: 'blur' },
            //         { min: 3, max: 7, message: '长度在 3 到 7 个字符', trigger: 'blur' }
            //     ],
            //     password:[
            //         { required: true, message: '请输入密码', trigger: 'blur' },
            //         { min: 6, max: 12, message: '长度在 6 到 12 个字符', trigger: 'blur' }
            //     ]
            // }
        }
    },
    methods: {
      login() {
        console.log(this.form)
        this.$router.push("/home")
        // localStorage.setItem('token',res.data.data.token)
        // localStorage.setItem('token',res.data.data.username)
      }
    }
}
</script>
